package com.news.servlet;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.news.entity.News;
import com.news.service.NewsService;

/**
 * Servlet implementation class showDetailNew
 */
@WebServlet("/showDetailNew")
public class ShowDetailNew extends HttpServlet {
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
	String newid=request.getParameter("newid");
	NewsService newsService=new NewsService();
	News neww=new News();
	neww=newsService.queryNewById(Integer.parseInt(newid));
	request.setAttribute("neww", neww);
	request.getRequestDispatcher("/jsp/newsDetail.jsp").forward(request, response);
	}
}
